import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/Home.vue'
import Category from '@/views/Category.vue'
import Search from '@/views/Search.vue'
import SearchList from '@/views/SearchList.vue'

Vue.use(Router)

export default new Router({
  routes: [{
    name: 'default',
    path: '/',
    redirect: {
      name: 'Home'
    }
  },
  {
    name: 'Home',
    path: '/home',
    component: Home
  },
  {
    name: 'Category',
    path: '/category',
    component: Category
  },
  {
    name: 'Search',
    path: '/search',
    component: Search
  },
  {
    name: 'SearchList',
    path: '/searchList/:key',
    component: SearchList
  }
  ],
  // 为导航项添加样式,添加类的形式
  linkActiveClass: 'isActive'
})
